home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5017 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.8 KB

  1. Path: sdd.hp.com!inn
  2. From: Laura Mansfield <laura>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: C++ and dynamic loading of libraries
  5. Date: 2 Feb 1996 04:37:31 GMT
  6. Organization: Hewlett-Packard, San Diego
  7. Message-ID: <4es4eb$au7@news.sdd.hp.com>
  8. References: <4eq0ip$al9@s854803.kb.be>
  9. NNTP-Posting-Host: hpsdlgd6.sdd.hp.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.12 (X11; I; HP-UX A.09.05 9000/730)
  14. X-URL: news:4eq0ip$al9@s854803.kb.be
  15.  
  16. I'm not sure if this is what you're looking for, but it's something
  17. I've seen done in Windows.  It's called run-time dynamic linking.
  18. If you wrote the C++ library that you're
  19. loading, you could add this to that code, or maybe include it the
  20. code that's using the library.
  21.  
  22. I would use a table that maps a string which is the name of the function
  23. to the address of that function.  You could use an entry point function
  24. in the library that would take as a parameter the string of the function
  25. name and return the pointer to that function.  Or if you do write the
  26. library code, you have the address of the exported functions, and you
  27. could write your own function and table to accomplish this.
  28.  
  29. u19809@kb.be (Wim Delvaux) wrote:
  30. >I would like to be able to load libraries generated from C++ from
  31. >other C++ code.  This is not a big problem but I would like to use the
  32. >libraries ON DEMAND ie. when the application needs it and not at
  33. >compile time. (Using LOADLIBRARY/FINDSYMBOL api calls of the dynamic
  34. >loader components of several OS-ses : Windows, Linux, Unix, ...)
  35. >
  36. >There is however the problem of the name mangling : What is the name
  37. >of the C++ function I need ?  
  38. >
  39. >Does there exist (compiler-specific) API's to mangle/demangle that can
  40. >be used from within an application ?
  41. >Does anybody have other suggestions how to do this ?
  42. >
  43. >Thanx
  44. >
  45. >Wim Delvaux
  46. >
  47. >Wim Delvaux
  48. >Kredietbank NV.
  49. >Belgium
  50. >+ 32 (0)2 422 74 64
  51. >
  52.  
  53. -- 
  54.  
  55. ************************************************************************
  56.  
  57. Laura C. Mansfield                              _/_/_/_/_/_/_/_/_/_/_/
  58. Hewlett-Packard Company                         _/        _/        _/
  59. San Diego Printer Division                                _/
  60. MS-60U360                                     _/_/_/_/_/  _/  _/      _/
  61. 16399 W. Bernardo Dr.                         _/      _/  _/  _/_/  _/_/
  62. San Diego, CA 92127-1899                      _/_/_/_/_/  _/  _/  _/  _/
  63.                                               _/      _/  _/  _/      _/
  64.                                               _/      _/  _/  _/      _/
  65.                                                           _/
  66. Gig' Em Aggies!                                       _/_/_/_/_/
  67.  
  68.  
  69. "Truth is more than an opposing point of view." - Susan Ashton
  70.  
  71. ************************************************************************
  72.  
  73.